Events.GameEraChanged.Add(function (previousEra, newEra)
	for playerId, player in ipairs(Players) do
		local playerConfig = PlayerConfigurations[playerId];
		local leader = playerConfig:GetLeaderTypeName();
		if ExposedMembers.DLHD.Utils.LeaderHasTrait(leader, 'TRAIT_LEADER_FIORE_FELICITA') then
			local eraType = GameInfo.Eras[newEra].EraType;
			local eras = Game.GetEras();
			-- dark era
			if eras:HasDarkAge(playerId) then
				for row in GameInfo.Technologies() do
					if row.EraType == eraType then
						if player:GetTechs():HasBoostBeenTriggered(row.Index) then
							ExposedMembers.GameEvents.AmesCompleteTech.Call(playerId, row.Index);
						end
					end
				end
				for row in GameInfo.Civics() do
					if row.EraType == eraType then
						if player:GetCulture():HasBoostBeenTriggered(row.Index) then
							ExposedMembers.GameEvents.AmesCompleteCivic.Call(playerId, row.Index);
						end
					end
				end
			end
			-- golden era
			if eras:HasGoldenAge(playerId) or eras:HasHeroicGoldenAge(playerId) then
				for row in GameInfo.Technologies() do
					if row.EraType == eraType then
						if not player:GetTechs():HasBoostBeenTriggered(row.Index) then
							ExposedMembers.GameEvents.AmesTiggerTechBoost.Call(playerId, row.Index);
						end
					end
				end
				for row in GameInfo.Civics() do
					if row.EraType == eraType then
						if not player:GetCulture():HasBoostBeenTriggered(row.Index) then
							ExposedMembers.GameEvents.AmesTiggerCivicBoost.Call(playerId, row.Index);
						end
					end
				end
			end
		end
	end
end);

Events.TechBoostTriggered.Add(function (playerId, techId, unknown1, unknown2)
	local playerConfig = PlayerConfigurations[playerId];
	local leader = playerConfig:GetLeaderTypeName();
	if ExposedMembers.DLHD.Utils.LeaderHasTrait(leader, 'TRAIT_LEADER_FIORE_FELICITA') then
		local eras = Game.GetEras();
		local eraType = GameInfo.Eras[eras:GetCurrentEra()].EraType;
		-- dark era
		if eras:HasDarkAge(playerId) then
			local row = GameInfo.Technologies[techId];
			if row.EraType == eraType then
				ExposedMembers.GameEvents.AmesCompleteTech.Call(playerId, row.Index);
			end
		end
	end
end);

Events.CivicBoostTriggered.Add(function (playerId, civicId, unknown1, unknown2)
	local playerConfig = PlayerConfigurations[playerId];
	local leader = playerConfig:GetLeaderTypeName();
	if ExposedMembers.DLHD.Utils.LeaderHasTrait(leader, 'TRAIT_LEADER_FIORE_FELICITA') then
		local eras = Game.GetEras();
		local eraType = GameInfo.Eras[eras:GetCurrentEra()].EraType;
		-- dark era
		if eras:HasDarkAge(playerId) then
			local row = GameInfo.Civics[civicId];
			if row.EraType == eraType then
				ExposedMembers.GameEvents.AmesCompleteCivic.Call(playerId, row.Index);
			end
		end
	end
end);